A semiconductor device such as a diode, a MOSFET (Metal Oxide Semiconductor Field Effect Transistor), an IGBT (Insulated Gate Bipolar Transistor), or the like is used in applications of, for example, power control. High reliability of the semiconductor device is desirable.